package com.company.Tree2;

/**
 * @author VX5
 * @Title: MJC
 * @ProjectName DataStructure
 * @Description: TODO
 * @date ${DAT}18:31
 */
public class BinaryTree {
    public static void main(String[] args) {

    }

    static class Node{
        private int no;
        private Node left;
        private Node right;

        public Node(int no) {
            this.no = no;
        }

        public int getNo() {
            return no;
        }

        public void setNo(int no) {
            this.no = no;
        }

        public Node getLeft() {
            return left;
        }

        public void setLeft(Node left) {
            this.left = left;
        }

        public Node getRight() {
            return right;
        }

        public void setRight(Node right) {
            this.right = right;
        }

        @Override
        public String toString() {
            return "Node{" +
                    "no=" + no +
                    '}';
        }

        void preOrder(){
            System.out.println(this);
            if (this.left!=null){
                this.left.preOrder();
            }
            if (this.right!=null){
                this.right.preOrder();
            }
        }

         private void getBypreOrder(int no){
            if (this.no == no){
                System.out.println("成功找到");
            }

         }
    }
}
